package org.xinjiang.data.migration.flush.enums;

import lombok.Getter;

@Getter
public enum MarriageEnum {

    UNMARRIED("1", "未婚", "01", 1),
    UNMARRIED_NO("否", "未婚", "01", 1),
    MARRIED("2", "已婚", "02", 2),
    MARRIED_YES("是", "已婚", "02", 2),
    DIVORCE("4", "离异", "03", 3),
    MARRIED_YH("yh", "已婚", "02", 2),
    MARRIED_Y("已婚", "已婚", "02", 2),
    DIVORCE_LH("离婚", "离异", "03", 3),
    BEREFT_OF_ONES_SPOUSE("3", "丧偶", "04", 4);

    /* 数据来源code
     */
    private String sourceCode;

    /**
     * 数据来源名成
     */
    private String sourceName;


    private String targetCode;

    private Integer id;

    MarriageEnum(String sourceCode, String sourceName, String targetCode, Integer id) {
        this.sourceCode = sourceCode;
        this.sourceName = sourceName;
        this.targetCode = targetCode;
        this.id = id;
    }

    public static MarriageEnum toCode(String sourceCode) {
        for (MarriageEnum value : MarriageEnum.values()) {
            if (value.sourceCode.equals(sourceCode)) {
                return value;
            }
        }
        return UNMARRIED;
    }
}
